﻿using System.Collections.Generic;

namespace Sustainalytics.ClientDW.Synchronization.RiskRatingsBenchmarks
{
    public class CustomComparer : IComparer<KeyValuePair<int, double>>
    {
        public int Compare(KeyValuePair<int, double> x, KeyValuePair<int, double> y)
        {
            if (x.Key > y.Key)
                return 1;

            if (x.Key < y.Key)
                return -1;

            if (x.Value > y.Value)
                return 1;

            if (x.Value < y.Value)
                return -1;

            return 0;
        }
    }

    public class Benchmark<T>
    {
        public int Count { get; set; }

        public int Rank { get; set; }

        public double Average { get; set; }

        public double Percentile { get; set; }

        public T Min { get; set; }

        public T Max { get; set; }
    }

    internal class CompanyScore<TK>
    {
        public TK Id { get; set; }

        public double? Score { get; set; }

        public double MarketCapitalization { get; set; }
    }

    public class Performance<T>
    {
        public double MarketCapFrom { get; set; }

        public double MarketCapTo { get; set; }


        public List<T> PeerList { get; set; }


        public static Performance<T> Default => new Performance<T> { MarketCapFrom = 0, MarketCapTo = 0, PeerList = new List<T>(0) }; 
    }

}